home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Online / httpproxy / src / net.h < prev    next >
C/C++ Source or Header  |  1996-08-20  |  2KB  |  66 lines

  1. /*(( "Header" */
  2. /*
  3.  * $Id: net.h,v 1.2 1996/07/17 16:42:42 mshopf Exp mshopf $
  4.  *
  5.  * (c) 1995-96 Matthias Hopf
  6.  * Network protocol encapsulation for httpproxy.
  7.  */
  8.  
  9. /*
  10.  * $Log: net.h,v $
  11.  * Revision 1.2  1996/07/17  16:42:42  mshopf
  12.  * added local host name entry.
  13.  *
  14.  * Revision 1.1  1996/06/03  04:17:23  mshopf
  15.  * Initial revision
  16.  *
  17.  */
  18.  
  19. /*)) */
  20.  
  21. #ifndef _NET_H__
  22. #define _NET_H__
  23.  
  24. /*(( "Constants" */
  25.  
  26. #define DEFAULT_HTTPPORT  80
  27. #define MIN_TIMEOUT       (1*60)   /* Timeouts are checked in this interval at least */
  28.  
  29. #ifndef FALSE
  30. #define FALSE            (0)
  31. #define TRUE             (1)
  32. #endif
  33.  
  34. /*)) */
  35. /*(( "Types" */
  36.  
  37. typedef struct {
  38.            const char *Descr;       /* Description */
  39.            const char *HostName;    /* local hostname (valid after init()) */
  40.            int  FDSize;             /* maximum FD set size (valid after initialisation) */
  41.            int  StdHttpPort;        /* Standard HTTP protocol port (valid after initialisation) */
  42.            int  (*init) (int);
  43.            void (*exit) (void);
  44.            int  (*select) (void (*)(int, const char *), void (*)(void)); /* wait for incoming / outgoing data */
  45.            int  (*checkread) (int);    /* check read possibility  */
  46.            int  (*checkwrite) (int);   /* check read possibility  */
  47.            int  (*read) (int, char *, int);
  48.            int  (*write) (int, char *, int);
  49.            int  (*server) (int);       /* open listen port */
  50.            int  (*open) (const char *, int); /* open connection to host */
  51.            void (*close) (int);        /* -> close */
  52.            void (*initfd) (int);       /* clear fd sets */
  53.            void (*setfdread) (int);    /* set fd in readable fdset */
  54.            void (*setfdwrite) (int);   /* set fd in writeable fdset */
  55.            const char * (*strerror) (int);  /* return enhanced error string */
  56.            } netmethods_t;
  57.  
  58. /*)) */
  59. /*(( "Global Variables" */
  60.  
  61. extern netmethods_t NetAmiTCP;       /* in net_amitcp.c */
  62. extern netmethods_t NetAS225;        /* in net_as225.c  */
  63.  
  64. /*)) */
  65. #endif /* _NET_H__ */
  66.